<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>">
<head>
    <meta charset="utf-8">

    <jdoc:include type="head" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="<?php echo JURI::base()."templates/".$this->template."/bootstrap/css/"?>bootstrap.min.css">
    <link rel="stylesheet" href="<?php echo JURI::base()."templates/".$this->template."/css/"?>template.css">
    <link rel="stylesheet" href="<?php echo JURI::base()."templates/".$this->template."/css/lang/"?><?php echo $this->language; ?>.css">

    <!--[if lt IE 8]>
    <link rel="stylesheet" href="<?php echo JURI::base()."templates/".$this->template."/css/"?>ie_all.css" type="text/css" />
    <![endif]-->

    <link rel="shortcut icon" type="image/x-icon" href="<?php echo JURI::base()."templates/".$this->template."/images/"?>favicon.ico">
    <?php
    $app = JFactory::getApplication();
    $siteName = $app->getCfg('sitename');
    $menu = $app->getMenu();
    /* Only load jQuery if not using Virtuemart*/
    $component =  JRequest::getVar('option');
    if($component != 'com_virtuemart'):
        $doc = JFactory::getDocument();
        $doc->addScript(JURI::base()."templates/".$this->template."/bootstrap/js/jquery-1.10.1.min.js");
    endif;


    //Obtain Languages
    $lang = JFactory::getLanguage();
    $locales = $lang->getLocale();
    $langTag = $lang->getTag();
    $langTagCountry = strtolower(substr($langTag, -2));

    if($langTagCountry=='gb'){$langName = 'International';}
    elseif($langTagCountry=='nl'){$langName = 'Nederlands';}
    elseif($langTagCountry=='de'){$langName = 'Deutsch';}
    elseif($langTagCountry=='pl'){$langName = 'Polish';}
    elseif($langTagCountry=='fr'){$langName = 'French';}
    elseif($langTagCountry=='es'){$langName = 'Spanish';}
    else{$langName = $lang->getName();}


    ?>

</head>
<jdoc:include type="modules" name="analytics" style="xhtml" />
<body>

<div class="container">
    <div class="row" id="top">
        <div class="span3" id="topLogo">
            <a href="index.php" alt="<?php echo $siteName;?>"><img src="<?php echo JURI::base()."templates/".$this->template."/images/"?>logo.png"></a>
        </div>
        <div class="span5 offset1" id="topSearch">
            <jdoc:include type="modules" name="topSearch" style="xhtml" />
        </div>
        <div class="span3" id="topLang">
            <div class="topLang">


                <div class="btn-group dropdown pull-right">
                    <button class="btn defaultLang"><img src="images/flags/<?php echo $langTagCountry;?>.png"><?php echo $langName;?></button>
                    <button class="btn dropdown-toggle" data-hover="dropdown" data-delay="1000"data-toggle="dropdown"><span class="caret"></span></button>
                    <jdoc:include type="modules" name="topLang"/>
                </div><!-- /btn-group -->
            </div>
            <div class="clearfix"></div>

            <div class="topCart hidden-phone">
                <jdoc:include type="modules" name="topCart" style="xhtml" />
            </div>


        </div>
    </div>


    <?php if($this->countModules('menu')) : ?>
        <div class="row" id="topNavigation">
            <div class="span12" id="nav1">
                <div id="menu" class=""><div class="menuContainer">
                        <?php if ($menu->getActive() == $menu->getDefault()):?>
                            <jdoc:include type="modules" name="menu" />
                        <?php else:?>
                            <div class="visible-phone">
                                <jdoc:include type="modules" name="menu-mobile" />
                            </div>
                            <div class="hidden-phone">
                                <jdoc:include type="modules" name="menu" />
                            </div>
                        <?php endif;?>
                    </div></div>
            </div>
        </div>
    <?php endif;?>

    <?php if($this->countModules('toptext')) : ?>
        <div class="row" id="toptext">
            <div class="span12">
                <jdoc:include type="modules" name="toptext" />
            </div>
        </div>
    <?php endif;?>


    <?php if($this->countModules('frontpage')) : ?>
        <div class="row hidden-phone" id="frontpage">
            <div class="span9">
                <jdoc:include type="modules" name="frontpage" />
            </div>
            <div class="span3" id="rightLinksContainer">
                <div id="rightLinks">
                    <jdoc:include type="modules" name="rightLinks" style="xhtml" />
                </div>
            </div>
        </div>
    <?php endif;?>


    <?php if($this->countModules('frontpage')) : ?>
        <div class="row hidden-phone" id="middle">
            <jdoc:include type="message" />
            <jdoc:include type="component" />
        </div>
    <?php endif;?>






    <?php if(!$this->countModules('frontpage')) : ?>
    <div class="row">

        <?php if($this->countModules('right')) : ?>
        <div class="span9">
            <?php else:?>
            <div class="span12">
                <?php endif;?>
                <?php if($this->countModules('breadcrumb')) : ?><div id="path"><jdoc:include type="modules" name="breadcrumb" /></div><?php endif; ?>
                <jdoc:include type="message" />
                <jdoc:include type="component" />
            </div>

            <?php if($this->countModules('right')) : ?>
                <div class="span3">
                    <div id="rightLinks">
                        <jdoc:include type="modules" name="right" style="xhtml" />
                    </div>
                </div>
            <?php endif;?>
        </div>
        <?php endif;?>

        <?php if($this->countModules('frontLeft')) : ?>
            <div class="row hidden-phone" id="frontpageMiddle">
                <div class="frontLeft span9">
                    <jdoc:include type="modules" name="frontLeft" style="xhtml" />
                </div>
                <div class="frontRight hidden-phone span3">
                    <jdoc:include type="modules" name="frontRight" style="xhtml" />
                </div>
            </div>

        <?php endif;?>

        <?php if($this->countModules('breadcrumbBottom')) : ?><div id="pathBottom"><jdoc:include type="modules" name="breadcrumbBottom" /></div><?php endif; ?>

        <?php if($this->countModules('productsBottom')) : ?>
            <div id="productsBottom" class="hidden-phone">
                <jdoc:include type="modules" name="productsBottom" style="xhtml" />
            </div>
        <?php endif;?>

        <?php if($this->countModules('messageBottom')) : ?>
            <div id="messageBottom" class="">
                <jdoc:include type="modules" name="messageBottom" style="xhtml" />
            </div>
        <?php endif;?>



        <div id="footer">

            <div class="row">
                <div class="span12" id="bottomSocialCont">
                    <div class="bottomSocial">

                    </div>
                </div>
            </div>

            <div class="row hidden-phone" id="menuBottom">
                <div class="span2"><jdoc:include type="modules" name="menuBottom1" style="xhtml" /></div>
                <div class="span2"><jdoc:include type="modules" name="menuBottom2" style="xhtml" /></div>
                <div class="span2"><jdoc:include type="modules" name="menuBottom3" style="xhtml" /></div>
                <div class="span2"><jdoc:include type="modules" name="menuBottom4" style="xhtml" /></div>
                <div class="span4" id="bottomSocialCont"><div class="bottomSocial"><jdoc:include type="modules" name="bottomSocial" style="xhtml" /></div></div>

            </div>

            <div class="footer">
                <jdoc:include type="modules" name="bottom" style="xhtml" />
            </div>



        </div>

    </div> <!-- /container -->



    <script src="<?php echo JURI::base()."templates/".$this->template."/bootstrap/js/"?>twitter-bootstrap-hover-dropdown.min.js"></script>
    <script src="<?php echo JURI::base()."templates/".$this->template."/js/"?>holder.js"></script>
    <script src="<?php echo JURI::base()."templates/".$this->template."/js/"?>main.js"></script>
    <script src="<?php echo JURI::base()."templates/".$this->template."/js/"?>respond.min.js"></script>


</body>
</html>